<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true" class="nav-custom">
			<!-- <block slot="backText">返回</block> -->
			<block slot="content">关于</block>
		</cu-custom>
		<view class="app-box" :style="{ height: appHeight + 'px' }">
			<!-- <video src="http://110.83.229.53:83/openUrl/Ma4dsVG/live.m3u8" /> -->
			<!-- <view @click="startPreview">3123</view> -->
			<!-- <hkVideo ref="hkvideo" @change="onWindChange" @previewChange="onPreviewChange"></hkVideo> -->
			<view class="main-title">
				<image src="../../static/image/home/symbol.png" />
				<view>
					<text>知汛情</text>
					<view class="versions">V 1.0.19</view>
				</view>
			</view>
			<view class="synopsis">
				知汛情手机气象客户端是由福建省三明市水利局权威打造，为决策、防汛、水利、应急等用户提供实时水雨工情、风险预警信息，以及风雨查询、检查上报、即时通讯、专项服务等功能业务。
			</view>
			<view class="QRcode">
				<image src="../../static/image/home/QRcode.png" />
			</view>
			<view class="version-list">
				<u-collapse-item v-for="(item, index) in itemList" :key="index">
					<!-- 自定义折叠面板1展开时的内容 -->
					<view class="collapse-title" slot="title">
						<view v-for="(val, i) in item.head" :key="i">
							<!-- <image src="../../static/image/home/newVersion.png" v-if="index == 0 && i == 0" /> -->
							<view class="present" v-if="index == 0 && i == 0"></view>
							{{ val }}
						</view>
					</view>
					<text class="collapse-item">
						{{ item.body }}
					</text>
				</u-collapse-item>
			</view>
		</view>
	</view>
</template>

<script>
	// import hkVideo from '@/components/hkVideo/index'
	export default {
		components: {
			// hkVideo
		},
		data() {
			return {
				appHeight: 0,
				itemList: [
					{
						head: ['版本号 V 1.0.19', '2024-09-30 更新'],
						body: '1、app山洪预警无数据与地灾点无数据整改\n2、App登陆时密码加密传输\n3、水雨工情统计表格增加序号\n4、监控点位，安砂水库默认展示\n5、修复密码中含有特殊字符无法登陆(如#等)\n6、增加登录失败提示，限制非法登录次数等相关措施',
						open: true,
						disabled: true
					},
					{
						head: ['版本号 V 1.0.18', '2024-06-11 更新'],
						body: '1、更新监测防控色斑图渲染\n2、更新水库分类',
						open: true,
						disabled: true
					},
					{
						head: ['版本号 V 1.0.17', '2024-02-05 更新'],
						body: '1、更新人员管理权限\n2、更新用户界面记住密码功能\n3、更新修改密码与编辑用户分离',
						open: true,
						disabled: true
					},
					{
						head: ['版本号 V 1.0.15', '2023-09-06 更新'],
						body: '1、即时通讯更新语音视频通话，用户消息通信',
						open: true,
						disabled: true
					},
					{
						head: ['版本号 V 1.0.14', '2023-07-31 更新'],
						body: '1、监测预警水情,工情开发全市可见',
						open: true,
						disabled: true
					},
					{
						head: ['版本号 V 1.0.13', '2023-07-21 更新'],
						body: '1、新增了即时通讯功能\n2、新增登录验证码\n3、修改事件上报接口',
						open: true,
						disabled: true
					}
				]
			}
		},
		mounted() {
			this.statPage()
		},
		computed: {},
		methods: {
			async statPage() {
				// 页面高度
				this.appHeight = await this.$getHeight('.nav-custom')
			},
			startPreview() {
				alert(2)
				this.$refs.hkvideo.startPreview('ws://110.83.229.53:559/openUrl/xcQsRaw', '测试设备').then(() => {
					console.log('预览成功')
				})
			},
			//分屏
			setLayout(layout) {
				this.$refs.hkvideo.setLayout(layout)
			},
			//是否全屏
			setFullScreen(n) {
				this.$refs.hkvideo.isFullScreen(false)
			},
			//选中窗口
			onWindChange(index) {
				console.log(index, 'windIndex')
			},
			//窗口预览改变
			onPreviewChange(e) {
				console.log(e, 'previewChange')
			}
		}
	}
</script>

<style lang="less" scoped>
	.app-box {
		padding: 20px;
		background-color: #ffffff;
	}

	.main-title {
		display: flex;
		align-items: center;
		margin-left: 17px;
		margin-top: 20px;

		> image {
			width: 70px;
			height: 70px;
		}

		> view {
			margin-left: 10px;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-around;
			height: 55px;

			text {
				font-family: '黑体';
				font-size: 18px;
				font-weight: 500;
				letter-spacing: 0em;
				text-align: left;
			}

			.versions {
				width: 100%;
				border: 1px solid #0094ff;
				background-color: #9dd6ff4f;
				font-size: 12px;
				height: 20px;
				text-align: center;
				line-height: 20px;
				border-radius: 5px;
				color: #0094ff;
			}
		}
	}

	.synopsis {
		margin: 8px auto;
		width: 320px;
		text-align: justify;
		text-indent: 27px;
		font-size: 13px;
		font-family: 'PingFang SC';
		font-weight: 500;
	}

	.QRcode {
		margin: 20px 0px;
		text-align: center;

		image {
			width: 200px;
			height: 200px;
		}
	}

	.version-list {
		max-height: calc(100% - 420px);
		overflow: auto;
	}

	::v-deep .u-collapse-head {
		font-size: 14px !important;
		border-top: 1px solid #00000009;
		border-bottom: 1px solid #00000009;
	}

	.collapse-title {
		display: flex;
		width: 100%;
		justify-content: space-between;

		view {
			font-family: PingFang SC;
			font-weight: 500;
			display: flex;
			align-items: center;
		}

		> view:nth-of-type(1) {
			image {
				width: 12px;
				height: 15px;
				margin-right: 5px;
			}
		}

		.present {
			width: 10px;
			height: 10px;
			background-color: #0085ff;
			border-radius: 50%;
			margin-right: 7px;
		}

		> view:nth-of-type(2) {
			color: #a4a4a4;
		}
	}

	::v-deep .u-collapse-body {
		background: #fbfbfb;
	}

	::v-deep .u-collapse-content {
		color: #575757;
		padding: 10px;
	}
</style>
